home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
dskut
/
fatman32.zip
/
FM32.TXT
< prev
Wrap
Text File
|
1987-06-02
|
13KB
|
348 lines
FM User's Guide
Version 3.2, June 2, 1987
Copyright (c) 1987 by Thomas Stepka
7702 Lunceford Lane
Falls Church, Va 22043
All rights reserved
1. Intended Audience
FM stands for FAT Manager, and FAT in turn stands for File
Allocation Table. The FAT is a data structure put on every disk
by DOS during formatting, and it keeps track of which sectors of
the disk are allocated to each file in the directory. If you
don't already know what a FAT or a cluster or a logical sector or
a cluster chain is, then you don't need this program.
2. Functions and Features
FM was written to plug a functionality hole in existing
utility software. I have often noticed DOS doing several retries
when trying to read a disk file, or even returning an I/O error;
but whenever I ran FORMAT or the Norton Utility DISKTEST, all
clusters would check out OK. I wanted a way to arbitrarily mark
areas of the disk off limits to I/O, and to restore those areas
at any future time if I so wished. FM is the result.
Following are the basic functions and features of FM:
a. List all clusters on the target disk by type (bad,
occupied or unused), with corresponding logical sector
numbers.
b. Display the status of a cluster or sector, including
which file or subdirectory (if any) occupies it.
c. Enter numbers and display results in either decimal, hex,
or octal.
d. Make unused clusters bad or reserved, so DOS will not use
them.
e. Make bad or reserved clusters good, available for use
again.
f. List all changes made to the FAT during a session.
2. FM Design Philosophy
Since the FAT is such a crucial data structure, FM takes
precautions to ensure the file structure on the target disk is
not corrupted. Specifically:
The B, G and R commands to change the status of a cluster
always give unambiguous feedback showing the results of the
command.
FM will not allow you to change the status of a cluster that
is occupied by file or subdirectory.
The C command shows a history of all changes since running
FM, so you can't forget what you have done.
FM copies the FAT of the target disk into memory and works
with the memory copy. It writes the FAT back to disk only when
you quit, and only if you give final approval. You can also
abort FM with control-c without changing the disk FAT.
3. One Word Of Caution
FM is not an every day utility - it is more a last resort.
FM performs a function normally thought to be left to DOS only.
Certainly, DOS assumes no applications program would ever change
the FAT in any way. Therefore, FM must be used realizing this,
and with a certain amount of caution as discussed below.
Do not run FM while on a network or in any situation where a
new file could be created on disk while FM is running. Either
remove or make sure you don't use any memory resident utilities
which can create a new file on the target disk (eg the Sidekick
Notepad).
FM reads the FAT only once at startup, and then works with a
memory copy of it. Thus, it cannot detect a new file created on
the target disk while it is running. So, if you tell FM to write
a new FAT at the end of a session, any new file will still be in
its directory, but its allocated clusters will be overwritten.
You will then find it difficult or impossible to read or copy
this file. This will only affect your new file, however, and
running CHKDSK/F will make things right again.
FM has one insecurity, because the C, F, and L commands
allow you to redirect their output to a disk file. If you
redirect output to the target disk you be in the situation
described above. Again, CHKDSK/F will fix the problem.
Finally, if you change the FAT and write a new one to a hard
disk, reboot DOS after exiting FM. This is because DOS keeps
part of the FAT in its own memory, and doesn't know the FAT has
been changed. Therefore, if you don't reboot DOS may allocate
disk space based on its outdated information about the FAT.
4. Running FM
FM runs on IBM-PC's AT's and clones using MS-DOS v 2.0 and
later. To run, FM requires anywhere from 66K of RAM (for a 360K
floppy) up to 160K (for a 30MB hard disk). Up to 2000 files may
exist on the disk, and as many as 100 subdirectories. FM may not
work on some disks formatted by DOS v 1.x.
Run CHKDSK/F on the target disk to remove orphaned clusters.
This is recommended but not necessary.
At the DOS prompt, type FM [d]. [d] is an optional drive
specifier; if you don't specify the drive, FM will type brief
operating instructions.
Once started, FM will read the boot sector to get basic
information about the structure of the disk. Disks formatted by
DOS v 1 have a different boot sector format from those formatted
by DOS v 2 and later; FM will not work with v1 disks.
FM then reads all copies of the FAT (typically there are
two). FM will compare all copies with each other, checking for
differences; if the copies are different FM will inform you and
ask your permission to assume the first FAT copy is the good one.
If you have been using the disk with no problems, just say yes,
and FM will then overwrite the bad copy with the good one at quit
(see Q command below) time.
Finally, FM reads the entire directory structure on the disk
and notes the name of the file occupying each cluster of the
disk.
5. FM Commands
Once up and running FM accepts the following commands.
SPECIFYING CLUSTERS AND SECTORS
When you want to examine or change a cluster, FM gives you the
option of specifying either the cluster, or any of the logical
sectors that make up the cluster. To specify a cluster type 'C'
followed by the cluster number, no intervening spaces. To
specify a logical sector type 'S' followed by the sector number;
FM then operates on the entire cluster of which that sector is a
part. You may use the N command, described below, to specify the
number base of your input. If you make a mistake FM comes back
with some help. If you find you want to abort a B, E, G or R
command, just hit the return (enter) key.
CTRL-C
Type ctrl-c at the command prompt to abort FM and return to DOS
with the FAT unchanged.
THE ? COMMAND
Lists a command summary, the current number base, and shows the
legal range of values for cluster and sector numbers.
THE B COMMAND
Marks the specified cluster bad, preventing DOS from writing to
it. You enter the cluster or sector number in the current number
base, controlled b